<template>
<SafeAreaContainer>
  <view class="container">
    <button type="default" @click="jump('/pages/index/index')">首页</button>
    <button type="default" @click="jump('/pages/other/other')">其他页</button>
    <view>store中的数据：{{ user.getAgeState }}</view>
    <view @click="setStore">设置store中的数据</view>
  </view>
</SafeAreaContainer>
</template>

<script>
import useStore from "@/store/index";
export default {
  data() {
    return {
      user: "",
      scrollTop: 0,
    };
  },
  onLoad() {
    const { user } = useStore();
    this.user = user;
  },
  methods: {
    jump(url) {
      return this.$jump(url);
    },
    setStore() {
      const { user } = useStore();
      user.setAgeState(19);
    }
  },
};
</script>

<style lang="scss" scoped>
.container {
}
</style>
